<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" import="com.wit.po.Area" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>客户区域修改</title>
<link href="../style/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet"  href="../style/style.css" />

<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript">
	function addNewArea()
	{
		var id = document.getElementById("areaId").value;
		var supid = document.getElementById("supAreaId").value;
		
		if((supid == <%=Area.ROOT_AREA_ID %> && id.length == <%=Area.STEP_LEN_OF_LEVEL %>)
							|| id.length-supid.length == <%=Area.STEP_LEN_OF_LEVEL %>)
		{
			editAreaForm.submit();
		}
		else
		{
			alert("区域编号只能比父区域多<%=Area.STEP_LEN_OF_LEVEL %>位");
		}
	}
</script>
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0" class="table">
  <tr>
    <td>
      <table width="100%" cellpadding="0" cellspacing="0" class="table2">
        <tr>
          <td valign="top">
            <div class="search" style="padding:10px">
            <s:form name="editAreaForm" id="editAreaForm" action="area!updateArea" method="post" theme="simple">
              <s:hidden id="t_areaId" name="areaId"></s:hidden>
              <s:hidden id="supAreaId" name="area.supAreaId"></s:hidden>
              <table cellpadding="0" cellspacing="0" width="100%" class="table5">
                  <tr>
                    <th height="29" bgcolor="#BBD2F7" class="title">修改区域</th>
                </tr>
                  <tbody>
                    <tr>
                     <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                         <tr>
                           <td>上级区域：</td>
                           <td><s:property value="area.supAreaId" default=""/></td>
                         </tr>
                         <tr>
                           <td>区域编号：</td>
                           <td>
						   		<s:textfield id="areaId" name="area.areaId" required="true"></s:textfield>
						   </td>
                         </tr>
                         <tr>
                           <td>区域名称：</td>
                           <td>
						   		<s:textfield id="areaName" name="area.areaName" required="true"></s:textfield>
                           </td>
                         </tr>
                       </table>
                       <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="center" style="padding-right:10px; border-top:solid 1px #A8CFEB">
          	<a href="javascript:void(0);" onclick="javascript:addNewArea();">
          		<span class="clientinfo_but" >确&nbsp;定</span>
          	</a>&nbsp;&nbsp;&nbsp;&nbsp;
          	<a href="javascript:void(0);">
          		<span class="clientinfo_but" >取&nbsp;消</span>
          	</a>
          </td>
        </tr>
      </table>
      					</td>
                    </tr>
                  </tbody>
                </table>
              </s:form>

            </div>

</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
